<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>{$is_language?'關連賬號列表':'List of connected accounts'}</title>
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <link rel="stylesheet" href="__MODULE_LIBS__/css/weui.min.css">
    <link rel="stylesheet" href="__MODULE_LIBS__/css/jquery-weui.css">
    <link rel="stylesheet" href="__MODULE_LIBS__/css/demos.css">
    <script src="__MODULE_LIBS__/js/jquery-2.1.4.js"></script>
    <script src="__MODULE_LIBS__/js/fastclick.js"></script>
    <script src="__MODULE_LIBS__/js/jquery-weui.js"></script>
    <style type="text/css">
        *{
            margin: 0;
            padding: 0;
        }
        html{
            width: 100%;
            height: 100%;
            font-size: 20px;
            font-family: "Microsoft YaHei", "宋体", "Segoe UI", "Lucida Grande", Helvetica, Arial, sans-serif, FreeSans, Arimo;
            background: #F3F3F3;
        }
        body{
            margin: 0 auto;
            max-width: 750px;
            height: 100%;
            background: #F7F7F7;
        }
        /*顶部导航栏处的样式*/
        .navbar{
            position: relative;
            width: 100%;
            height: 2rem;
            font-size: 16px;
            color: #fff;
            line-height: 2rem;
            background: #373553;
        }
        .navbar-item{
            position: absolute;
            left: 0;
            top:0;
            display: block;
            width: 3.2rem;
            height: 2rem;
            font-size: 14px;
            color: #fff;
            text-align: center;
        }
        .navbar-item>img{
            width: 0.8rem;
            height: 0.7rem;
            vertical-align: middle;
        }
        .navbar-center{
            text-align: center;
        }
        .content{
            width: 100%;
        }
        /*新增账号处的样式*/
        .weui-cell{
            padding: 10px 0.4rem;
            color: #F44444;
            background: #FFFFFF;
        }
        /*列表样式*/
        .weui-grids:after,.weui-grid:before,.weui-grid:after{
            border: 0;
        }
        .weui-grids{
            background: #fff;
        }
        .weui-grids:last-child{
            border-bottom: 1px #eee solid;
        }
        .weui-grid{
            padding: 0.2rem 0;
        }
        .weui-grid__icon{
            width: 100%;
            height: 100%;
            font-size: 15px;
        }
        .weui-grid__label{
            font-size: 13px;
        }
        .account{
            padding-left:0.4rem;
            color: #000;
        }
        .account>p{
            text-align: left;
        }
        .assets,.assets>p{
            color: #f44444;
        }
        .assets>div{
            text-align: center;
        }
        .change{
            padding-right:0.4rem;
            color: #999;
        }
        .change>div{
            font-size: 12px;
            text-align: right;
            line-height: 2.0;
        }
        .change>p{
            text-align: right;
        }
        .change>p>a{
            display: inline-block;
            width: 2rem;
            height: 100%;
            color: #468ee6;
        }
        .pagination > li {
            float: left;
            padding: 2px 6px;
            margin: 0 4px;
            list-style: none;
            color: #fff;
            background: #aaa;
            border-radius: 5px;
        }

        .pagination > li > a {
            color: #fff;
        }

        .pagination > li.active {
            background: #f44444;
        }
    </style>
</head>
<body>
<header class="navbar">
    <a href="{:url('index/index')}" class="navbar-item">
        <img src="__MODULE_LIBS__/img/back.png" />&nbsp;{$is_language?'返回':'Return'}
    </a>
    <div class="navbar-center">{$is_language?'關連賬號列表':'List of connected accounts'}</div>
    <div class="navbar-item1">
        <select name="" id="yy">
            <option value="1" {$is_language?'selected':''}>中文</option>
            <option value="0" {$is_language?'':'selected'}>English</option>
        </select>
    </div>
</header>
<div class="content">
    <a class="weui-cell" href="{:url('main')}">
        <div class="weui-cell__bd">
            <p>{$is_language?'新增賬號':'Add account'}+</p>
        </div>
    </a>

    <!--重复部分开始-->
    {foreach $users as $vo}
    <div class="weui-grids">
        <div href="javascript:;" class="weui-grid account">
            <div class="weui-grid__icon">{$vo.nickname}</div>
            <p class="weui-grid__label">{$vo.username}</p>
        </div>
        <div href="javascript:;" class="weui-grid assets">
            <div class="weui-grid__icon">${$vo->sum_money}</div>
            <p class="weui-grid__label">{$is_language?'總資產':'Total assets'}</p>
        </div>
        <div href="javascript:;" class="weui-grid change">
            <div class="weui-grid__icon">{$vo.create_time|date="Y-m-d H:i:s",###}</div>
            <p class="weui-grid__label">
                <a href="{:url('main',['id'=>$vo.id])}">{$is_language?'修改':'modify'}</a>
            </p>
        </div>
    </div>
    {/foreach}
</div>
{$users->render()}

<script type="text/javascript">
    $(document).on("change",'select#yy',function(){
        var yy = $(this).val();
        console.log(yy)
        var url = "{:url('index/language')}";
        $.post(url,{language:yy},function (res) {
            window.location.reload();
        })
    });
    $(function(){
        FastClick.attach(document.body);
    })
</script>
</body>
</html>
